package com.cn.action;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class AuthorInterceptor  extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		
		 
			// 判断是否登录,如果登录,放行,没有登录,跳转到登录页面.
		String adminUser = (String)ActionContext.getContext().getSession().get("exitadmincustomer");
					
				
			System.out.println("adminUser"+adminUser);
			if(adminUser== null){
				
				return "loginfaile";
				
			}else{
				
				return invocation.invoke();
			}
	}


	

}
